<?php

use yii\helpers\Url;

$js=<<<JS
    
$("select[name='search_files']").val("{$search_files}");
    
JS;

$this->registerJs($js);

?>

<div class="row">
  
    <div class="col-md-12">
    	 <div class="panel panel-default">
    	 <div class="panel-heading">日志查询</div>
    	 <div class="panel-body">
        	<form class="form-inline" action="<?= Url::toRoute(['index']) ?>" method="post">
              
              
           	<div class="form-group">
                <label for="business_id">查询文件</label>
                
                <select class="form-control" name="search_files">
                      <option value="">请选择查询的日志文件</option>
                      <?php 
                            if ($logs):
                            foreach($logs as $val) :
                            if ($val != '.' && $val != '..') :
                      ?>
                      		<option value="<?= $val;?>"><?= $val; ?></option>
                      
                      <?php 
                        endif;
                        endforeach;
                        endif;
                      ?>
                </select>
            
              </div>

              <div class="form-group">
                <label for="business_id">查询内容</label>
                <input type="text" class="form-control" id="search_words" placeholder="查询单词" name="search_words" value="<?= $search_words?>">
              </div>

              <button type="submit" class="btn btn-default">查询</button>
            </form>
            </div>
        </div>
        </div>

	<div class="col-md-12">
		
		    <div class="panel panel-primary">
        <div class="panel-heading">查询结果</div>
        <div class="panel-body">
            
            <?php 
                if ($data) :
                foreach ($data as $item) :
            ?>

			
			<p>
			<?= $item?>
			</p>

            <?php 
                endforeach;
                endif;
            ?>
                 
        </div>
    </div>
		
		
	</div>
</div>